<?php

namespace Views\Widgets;

/**
 * @author Evgeny Baranov <evgeny@baranov.eu>
 */
abstract class Base extends \Views\Base {
    /**
     * @var array
     */
    protected $param = array();

    /**
     * @param \DOMNode $target
     * @return \DOMDocumentFragment
     */
    public function render(\DOMNode $target) {
        $this->getParams($target);
        return parent::render();
    }

    /**
     * @param \DOMNode $target
     */
    protected function getParams(\DOMNode $target) {
        foreach ($target->attributes as $n => $a) {
            $this->param[$n] = $a->value;
        }
    }
}